#!/bin/bash
#provide a fake copy of all code for verilator to search for
#USAGE: bash ./script/shadowed_src.sh $(REPORT_FILE) $(OBJ_DIR)

#elaborate TB hierarchy
ABS_PATH=$(pwd)
    cat $1 |sed '/^[  ]*$/d'|sed '/^\s*$/d' >/tmp/temp.rpt

    cat /tmp/temp.rpt | while read line
	do
        srcname=$(echo $line | sed 's/^.*\.\///g')
        filename=$(echo $line|rev|sed 's/\/.*$//g'|rev)
        echo $ABS_PATH/$srcname
        echo $2$filename
        ln -s $ABS_PATH/$srcname $2$filename
	done